﻿using System.Web.Http;
using Autofac;

namespace Freedom.Framework.Mvc.Routes
{
    public class WebApiConfig
    {
        public static void Register(HttpConfiguration config, IContainer container )
        {
            foreach(var module in Utils.GetModuleInfo())
            {
                var routeProvider = container.ResolveKeyed<IRouteProvider>(string.Format("{0}.RouteProvider", module.Name).ToLower());
                routeProvider.GetApiRoutes(config.Routes);
            }
        }
    }
}
